status = -1;
var itemList = Array(1552058, 1542059, 1212069, 1222064, 1232063, 1242068, 1302227, 1312116, 1322162, 1332193, 1362067, 1372139, 1382168, 1402151, 1262007, 1412104, 1422107, 1432138, 1442182, 1452170, 1462159, 1472179, 1482140, 1492152, 1522071, 1532074);

function start() {
    action(1, 0, 0)
}

function action(h, d, c) {
    if (h == 1) {
        status++
    } else {
        if (h == 0 && status == 0) {
            im.dispose();
            return
        }
        status--
    }
    if (status == 0) {
        var g = "";
        for (var b = 0; b < itemList.length; b++) {
            g += "#L" + b + "##v" + itemList[b] + "##z" + itemList[b] + "##l\r\n"
        }
        im.askMenu("请选择你要的：\r\n#r" + g)
    } else {
        if (status == 1) {
            var f = itemList[c];
            var a = Math.floor(Math.random() * 1 + 1);
            var e = im.gainGachaponItem(f, a, "专属紫金枫叶武器");
            im.gainItem(2431402, -1);
            im.sendOk("恭喜您，获得了" + a + "个#b#z" + f + "#");
            im.dispose()
        }
    }
}
var status = -1;